package com.example.kotlintest.func

fun main() {

//lamdba 函数
    var lambda = {a:Int,b:Int -> a+b; }
    println("lambda:${lambda(1,2)}")

//    匿名内部类
    val anonymous = fun(a:Int,b:Int):Int{
        return a+b
    }
    println("anonymous:${anonymous(1,2)}")

//    lambda定义尝试
    var lam = lambdaBody(1){
        2
    };
    println("lam:$lam")
}

fun lambdaBody(a:Int,c: (Int) -> Int):Int{
 return a+c(0);
}

fun add(a:Int,b:Int):Int{
    return a+b
}
